<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<iframe src="//player.bilibili.com/player.html?aid=822361616&bvid=BV1yg4y1n7ok&cid=1021753829&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>
<script>

  // 同步代码
  console.log('0');

  // 宏任务
  setTimeout(function () {
    console.log('1');
  }, 0);

  // 微任务
  new Promise((resolve)=>{
    resolve()
    console.log('2')
  }).then(()=>{
    Promise.resolve().then(()=>{
      console.log('3')
    })

    Promise.resolve().then(()=>{
      console.log('20')
    })

  }).then(()=>{
    Promise.resolve().then(()=>{
      console.log('4')
    })
  })

  new Promise((resolve)=>{
    resolve()
    console.log('5')
  }).then(()=>{
    Promise.resolve().then(()=>{
      console.log('6')
    })
  }).then(()=>{
    Promise.resolve().then(()=>{
      console.log('7')
    })
  })

  // 同步代码
  console.log('100');


  // 0 2 4 3 1
</script>
</body>
</html>
